package com.uzai.common.enums.mini;

/**
 * The enum Mini order status.
 *
 * @author mingyang.chen create in 2023/11/1 17:09
 */
public enum MiniOrderServiceStatus {

    CANCEL(-1, "已取消"),

    WAIT_HANDLE(0, "待处理"),

    REFUNDING(1, "退款中"),

    REFUND_SUCCESS(2, "退款成功"),

    REFUND_REJECT(3, "拒绝退款"),

    REFUND_FAIL(4, "退款失败"),

    WAIT_BUY_SEND(5, "待买家发货"),

    BUY_SEND(6, "买家已发货"),

    REJECT_REFUND_AND_GOODS(7, "商家拒绝退货退款申请"),

    REPLACE_SUCCESS(8, "换货完成"),

    REJECT_REPLACE_GOODS(9, "商家拒绝换货申请"),

    TO_CUSTOMER(10, "转交客服"),

    WAIT_BUY_RECEIVED(11, "待买家收货"),

    REJECT_REFUND_AND_GOODS_RECEIVE(12, "商家收货之后拒绝退货退款"),

    REJECT_REPLACE_GOODS_RECEIVE(13, "商家收货之后拒绝换货"),

    ;

    private final Integer code;
    private String desc;

    MiniOrderServiceStatus(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MiniOrderServiceStatus getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (MiniOrderServiceStatus type : MiniOrderServiceStatus.values()) {
            if (type.getCode().intValue() == code) {
                return type;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

}
